const User = require('../models/user')
const Sequelize = require('sequelize')
exports.login = function (name, callback) {
    User.findOne({where: {name}}).then(user => {
        if(!user) {
            callback(user)
        }else {
            callback(user.get({
                plain: true
            }))
        }
    })
}

exports.updatePassword = function(name, password) {
  User.update({password},{where:{name}})
}